﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ControlPannel.aspx.cs" Inherits="WebApplication1.ControlPannel" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
        <style type="text/css" >
center
{
    width:0px;
    height:0px;
    display:none;
    }    
</style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="id"
            DataSourceID="SqlDataSource1" 
            EmptyDataText="There are no data records to display." AllowPaging="True" 
            AllowSorting="True" PageSize="20">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                    ShowSelectButton="True" />
                <asp:BoundField DataField="id" HeaderText="id" ReadOnly="True" SortExpression="id" />
                <asp:BoundField DataField="videoID" HeaderText="videoID" SortExpression="videoID" />
                <asp:BoundField DataField="title" HeaderText="title" SortExpression="title" />
                <asp:BoundField DataField="date" HeaderText="date" SortExpression="date" />
                <asp:BoundField DataField="mainTag" HeaderText="mainTag" SortExpression="mainTag" />
                <asp:BoundField DataField="subTag" HeaderText="subTag" SortExpression="subTag" />
                <asp:BoundField DataField="rtspHQ" HeaderText="rtspHQ" SortExpression="rtspHQ" />
                <asp:BoundField DataField="rtspNormal" HeaderText="rtspNormal" SortExpression="rtspNormal" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:connmTunez %>"
            DeleteCommand="DELETE FROM [tabmTunez] WHERE [id] = @id" InsertCommand="INSERT INTO [tabmTunez] ([videoID], [title], [date], [mainTag], [subTag], [rtspHQ], [rtspNormal]) VALUES (@videoID, @title, @date, @mainTag, @subTag, @rtspHQ, @rtspNormal)"
            ProviderName="<%$ ConnectionStrings:connmTunez.ProviderName %>" SelectCommand="SELECT * FROM [tabmTunez] ORDER BY [date] DESC"
            
            UpdateCommand="UPDATE [tabmTunez] SET [videoID] = @videoID, [title] = @title, [date] = @date, [mainTag] = @mainTag, [subTag] = @subTag, [rtspHQ] = @rtspHQ, [rtspNormal] = @rtspNormal WHERE [id] = @id">
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="videoID" Type="String" />
                <asp:Parameter Name="title" Type="String" />
                <asp:Parameter Name="date" Type="DateTime" />
                <asp:Parameter Name="mainTag" Type="String" />
                <asp:Parameter Name="subTag" Type="String" />
                <asp:Parameter Name="rtspHQ" Type="String" />
                <asp:Parameter Name="rtspNormal" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="videoID" Type="String" />
                <asp:Parameter Name="title" Type="String" />
                <asp:Parameter Name="date" Type="DateTime" />
                <asp:Parameter Name="mainTag" Type="String" />
                <asp:Parameter Name="subTag" Type="String" />
                <asp:Parameter Name="rtspHQ" Type="String" />
                <asp:Parameter Name="rtspNormal" Type="String" />
                <asp:Parameter Name="id" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
        <asp:Button ID="Button1" runat="server" Text="Exit" onclick="Button1_Click" />
        <br />
       <table>
       <tr><td>VideoID: </td><td>
           <asp:TextBox ID="txtVID" runat="server"></asp:TextBox></td>     <td>Title: </td><td>
           <asp:TextBox ID="txtTitle" runat="server"></asp:TextBox></td></tr>
          <tr><td>Main Tag: </td><td>
              <asp:DropDownList ID="txtMTag" runat="server" EnableTheming="False">
                  <asp:ListItem>Science tunez</asp:ListItem>
                  <asp:ListItem>College tunez</asp:ListItem>
                  <asp:ListItem>Remarkable tunez</asp:ListItem>
                  <asp:ListItem>Enviroment</asp:ListItem>
                  <asp:ListItem>Tech tunez</asp:ListItem>
                  <asp:ListItem>Dance</asp:ListItem>
                  <asp:ListItem>Future tunez</asp:ListItem>
                  <asp:ListItem>Univers</asp:ListItem>
                  <asp:ListItem>Music</asp:ListItem>
              </asp:DropDownList>             
          </td>     <td>Sub Tag: </td><td><asp:TextBox ID="txtSubTag" runat="server"></asp:TextBox></td></tr>
     <tr><td>rtspHQ: </td><td><asp:TextBox ID="txtHQ" runat="server"></asp:TextBox></td>     <td>rtspNormal</td><td>
         <asp:TextBox ID="txtNormal" runat="server"></asp:TextBox></td></tr>
        <tr><td>
            
            </td><td colspan= 4 ><asp:Button ID="btnUpdate" runat="server" Text="Update" 
                    onclick="btnUpdate_Click" /></td></tr>

       </table>
    </div>
    <div>
        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataKeyNames="id"
            DataSourceID="SqlDataSource2" 
            EmptyDataText="There are no data records to display." AllowPaging="True">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="id" HeaderText="id" ReadOnly="True" SortExpression="id" />
                <asp:BoundField DataField="album" HeaderText="album" SortExpression="album" />
                <asp:BoundField DataField="date" HeaderText="date" SortExpression="date" />
                <asp:BoundField DataField="albumCover" HeaderText="albumCover" SortExpression="albumCover" />
            </Columns>
        </asp:GridView>
        <table>
       <tr><td>Album: </td><td>
           <asp:TextBox ID="txtAlbum" runat="server"></asp:TextBox></td>     <td>AlbumCover: </td><td>
           <asp:TextBox ID="txtAlbumCover" runat="server"></asp:TextBox></td></tr>
    
        <tr><td>
            
            </td><td colspan= 4 ><asp:Button ID="Button2" runat="server" Text="Update" 
                    onclick="btnUpdateAlbum_Click" /></td></tr>

       </table>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:connmTunez %>"
            DeleteCommand="DELETE FROM [tabAlbum] WHERE [id] = @id" InsertCommand="INSERT INTO [tabAlbum] ([album], [date], [albumCover]) VALUES (@album, @date, @albumCover)"
            ProviderName="<%$ ConnectionStrings:connmTunez.ProviderName %>" SelectCommand="SELECT [id], [album], [date], [albumCover] FROM [tabAlbum]"
            UpdateCommand="UPDATE [tabAlbum] SET [album] = @album, [date] = @date, [albumCover] = @albumCover WHERE [id] = @id">
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="album" Type="String" />
                <asp:Parameter Name="date" Type="DateTime" />
                <asp:Parameter Name="albumCover" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="album" Type="String" />
                <asp:Parameter Name="date" Type="DateTime" />
                <asp:Parameter Name="albumCover" Type="String" />
                <asp:Parameter Name="id" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
        <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" DataKeyNames="id"
            DataSourceID="SqlDataSource4" 
            EmptyDataText="There are no data records to display." AllowPaging="True">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="id" HeaderText="id" ReadOnly="True" SortExpression="id" />
                <asp:BoundField DataField="album" HeaderText="album" SortExpression="album" />
                <asp:BoundField DataField="song" HeaderText="song" SortExpression="song" />
                <asp:BoundField DataField="sngTitle" HeaderText="sngTitle" SortExpression="sngTitle" />
                <asp:BoundField DataField="sngArtist" HeaderText="sngArtist" SortExpression="sngArtist" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:connmTunez %>"
            DeleteCommand="DELETE FROM [tabSng] WHERE [id] = @id" InsertCommand="INSERT INTO [tabSng] ([album], [song], [sngTitle], [sngArtist]) VALUES (@album, @song, @sngTitle, @sngArtist)"
            ProviderName="<%$ ConnectionStrings:connmTunez.ProviderName %>" SelectCommand="SELECT [id], [album], [song], [sngTitle], [sngArtist] FROM [tabSng]"
            UpdateCommand="UPDATE [tabSng] SET [album] = @album, [song] = @song, [sngTitle] = @sngTitle, [sngArtist] = @sngArtist WHERE [id] = @id">
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="album" Type="String" />
                <asp:Parameter Name="song" Type="String" />
                <asp:Parameter Name="sngTitle" Type="String" />
                <asp:Parameter Name="sngArtist" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="album" Type="String" />
                <asp:Parameter Name="song" Type="String" />
                <asp:Parameter Name="sngTitle" Type="String" />
                <asp:Parameter Name="sngArtist" Type="String" />
                <asp:Parameter Name="id" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
        <table>
       <tr><td>Album: </td><td>
           <asp:TextBox ID="txtSngAlbum" runat="server"></asp:TextBox></td>     <td>Song: </td><td>
           <asp:TextBox ID="txtSngSong" runat="server"></asp:TextBox></td></tr>
          <tr><td>SngTitile: </td><td>
            <asp:TextBox ID="txtSngTitle" runat="server"></asp:TextBox>            
          </td>     <td>SngArtist: </td><td><asp:TextBox ID="txtSngArtist" runat="server"></asp:TextBox></td></tr>  
        <tr><td>
            
            </td><td colspan= 4 ><asp:Button ID="Button3" runat="server" Text="Update" 
                    onclick="btnUpdateSng_Click" /></td></tr>

       </table>
    </div>
    </form>
       <script  type="text/javascript">
           document.body.insertAdjacentHTML = null;
           function btnSrch_onclick() {
               window.location = "http://" + location.host + "/Home.aspx" + "?title=" + document.getElementById("search").value;
           }
</script>
</body>
</html>
